#pragma once

#include "..\resource.h"

#include "..\GUI\GUI.h"
#include "..\..\CommLib\CommServer.h"
#include "..\..\CommLib\CommStructs.h"
#include "..\..\CommLib\PacketConven.h"

//extern HWND g_hDock;
//extern HWND g_hWnd;
//extern HINSTANCE g_hInstance;
#include <stdarg.h>

class CViewer
{
private:
	static Server CViewer::g_server;
	
	static void PacketHandler(Connection::Packet* pPacket);

	static void OnPacketNetwork(Connection::Packet* pPacket);
	static void OnPacketQuery(Connection::Packet* pPacket);
	static void OnPacketUpdate(Connection::Packet* pPacket);

public:
	static void OnUpdate(void);
	static void OnInitalize(void);
	static void OnShutdown(void);
	static void OnRenderFrame(void);
	static void OnKeyboardEvent(UINT *pKeyboardState);
	static void OnMouseEvent(const int dxMouse, const int dyMouse, const int leftButton, const int rightButton);

	static void Error(const char* format,...);
	static void SetSelection(const StreamedMesh* pMesh);
	static void GetSelection(StreamedMesh** pOut);

	enum ViewerMode {
		NAVIGATE_FREEVIEW,
		NAVIGATE_MAYA,
		NAVIGATE_UI
	};
	static ViewerMode Mode;
	static ViewerMode LastMode;
};

